package com.hotline.monitor.enums;

public enum ReturnCodeEnum {

    SUCCESS("0","成功"),
    ALREADY_LOGIN("100-002","坐席已经登录"),
    NO_RIGHT("000-003","无权请求资源"),
    NOT_LOGIN("100-006","坐席未登录");



    /**
     * 编码
     */
    private String code;

    /**
     * 名称
     */
    private String name;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    ReturnCodeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static ReturnCodeEnum getReturnCodeEnum(String code){
        for (ReturnCodeEnum returnCodeEnum : ReturnCodeEnum.values()){
            if(returnCodeEnum.getCode().equals(code)){
                return returnCodeEnum;
            }
        }
        return null;
    }
}
